Component({
    /**
	 * 组件的属性列表
	 */
    properties: {
        name: {
            type:String,
            value:''
        },
        src: {
            type:String,
            value:''
        },
        width:{
            type:String,
            value:'98'
        },
        height:{
            type:String,
            value:'98'
        },
    },
    /**
	 * 组件的初始数据
	 */
    data: {
        userName:'',
        colorList:['#FFA500','#008002','#0D7DFF'],
        color:''
    },
    ready(){
        this.setData({
            userName:this.properties.name.substring(this.properties.name.length-2,this.properties.name.length)
        })
        this.setData({
            color:this.data.colorList[Math.floor(Math.random() * 3)]
        })
    }
})